var express = require('express');
var router = express.Router();


module.exports = function(passport, nev){
	var userManagementCtrl = require('../controllers/UserManagementCtrl')(passport, nev);
	var homeCtrl = require('../controllers/HomeCtrl')(passport);
	/* GET home page. */
	router.get('/', function(req, res) {
	  res.render('index');
	});
	// user management --- start
	router.get('/rest/checkUserAvail/:username', userManagementCtrl.checkUserAvail);
	//send out reset password email
	router.post('/rest/resetPwd', userManagementCtrl.resetPwd);
	router.post('/rest/changePwd', userManagementCtrl.changePwd);
	router.post('/rest/resendConfirmEmail', userManagementCtrl.resendConfirmEmail);

	router.post('/signIn', userManagementCtrl.signIn);

	router.post('/signUp', userManagementCtrl.signUp);

	router.get('/email-verification/:URL', userManagementCtrl.verifyEmail);
	// user management --- end

	//main functionality --- start
	router.get('/rest/user/:userId', homeCtrl.getUserInfo);
	//main functionality --- end
	return router;
};
